package sudroid.android.graphics.gif;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Movie;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.view.View;

public class MovieView extends View
{
  private long mMovieStart;
  private Movie movie;
  private int movieHeight;
  private int movieWidth;

  public MovieView(Context paramContext)
  {
    super(paramContext);
  }

  public MovieView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
  }

  public MovieView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
  {
    super(paramContext, paramAttributeSet, paramInt);
  }

  public int getMovieHeight()
  {
    int i;
    if (this.movieHeight == 0)
    {
      i = this.movie.height();
      this.movieHeight = i;
    }
    while (true)
    {
      return i;
      i = this.movieHeight;
    }
  }

  public int getMovieWidth()
  {
    int i;
    if (this.movieWidth == 0)
    {
      i = this.movie.width();
      this.movieWidth = i;
    }
    while (true)
    {
      return i;
      i = this.movieWidth;
    }
  }

  protected void onDraw(Canvas paramCanvas)
  {
    super.onDraw(paramCanvas);
    if (this.movie != null)
    {
      long l1 = SystemClock.uptimeMillis();
      if (this.mMovieStart == 0L)
        this.mMovieStart = l1;
      int i = this.movie.duration();
      if (i == 0)
        i = 1000;
      long l2 = this.mMovieStart;
      long l3 = l1 - l2;
      long l4 = i;
      int j = (int)(l3 % l4);
      boolean bool = this.movie.setTime(j);
      this.movie.draw(paramCanvas, 0.0F, 0.0F);
      invalidate();
    }
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    int i = getPaddingLeft();
    int j = getPaddingRight();
    int k = getPaddingTop();
    int m = getPaddingBottom();
    int n;
    if (this.movie == null)
      n = 1;
    for (int i1 = 1; ; i1 = getMovieHeight())
    {
      int i2 = i + j;
      int i3 = n + i2;
      int i4 = k + m;
      int i5 = i1 + i4;
      int i6 = getSuggestedMinimumWidth();
      int i7 = Math.max(i3, i6);
      int i8 = getSuggestedMinimumHeight();
      int i9 = Math.max(i5, i8);
      int i10 = resolveSize(i7, paramInt1);
      int i11 = resolveSize(i9, paramInt2);
      setMeasuredDimension(i10, i11);
      return;
      n = getMovieWidth();
    }
  }

  public void setMovie(Movie paramMovie)
  {
    this.movie = paramMovie;
    requestLayout();
    postInvalidate();
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     sudroid.android.graphics.gif.MovieView
 * JD-Core Version:    0.6.0
 */